package com.biejiaogroup.librarymanager.mapper;

import com.biejiaogroup.librarymanager.entity.Book;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Vector;

/**
 * @Author: JesseChan
 * @Date: 2022/5/5
 */
@Mapper
public interface BookMapper {
    /**
     * @param
     * @return: java.util.Vector<com.biejiaogroup.librarymanager.entity.Book>
     * @Description: 查询所有图书
     * @Author: JesseChan
     * @Date: 2022/5/4
     */
    public Vector<Book> queryAllBook();

    /**
     * @param bookName
     * @return: java.util.Vector<com.biejiaogroup.librarymanager.entity.Book>
     * @Description: 查询包含特定字符的图书
     * @Author: JesseChan
     * @Date: 2022/5/5
     */
    public Vector<Book> queryBookByName(String bookName);

    /**
     * @param book
     * @return: void
     * @Description: 添加图书
     * @Author: JesseChan
     * @Date: 2022/5/5
     */
    public void insertBook(Book book);

    /**
     * @param book
     * @return: void
     * @Description: 修改图书信息
     * @Author: JesseChan
     * @Date: 2022/5/5
     */
    public void updateBook(Book book);

    /**
     * @param bookID
     * @return: void
     * @Description: 删除指定ID的图书
     * @Author: JesseChan
     * @Date: 2022/5/5
     */
    public void deleteBook(Integer bookID);

    /**
     * @param bookID
     * @return: com.biejiaogroup.librarymanager.entity.Book
     * @Description: 根据ID查询图书
     * @Author: JesseChan
     * @Date: 2022/5/6
     */
    public Book queryBookByID(Integer bookID);

    /**
     * @param userID
     * @param bookID
     * @return: void
     * @Description: 借书
     * @Author: JesseChan
     * @Date: 2022/5/6
     */
    public void borrowBook(@Param("belongTo") Integer userID, @Param("bookID") Integer bookID);

    /**
     * @param bookID
     * @return: void
     * @Description: 还书
     * @Author: JesseChan
     * @Date: 2022/5/6
     */
    public void returnBook(Integer bookID);




}
